package com.hzzy.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hzzy.IDao.HzClassCourseMapper;
import com.hzzy.IDao.HzTeacherMapper;
import com.hzzy.bean.HzClassCourseExample;
import com.hzzy.bean.HzTeacherExample;
import com.hzzy.service.CheckDataService;

@Service
public class CheckDataServiceImpl implements CheckDataService {

	@Autowired
	private HzTeacherMapper hzTeacherMapper;
	
	@Autowired
	private HzClassCourseMapper hzClassCourseMapper;
	
	
	public boolean checkTeacherId(String teacherId) {
		HzTeacherExample example = new HzTeacherExample();
		example.createCriteria().andTeacherIdEqualTo(teacherId);
		int count = hzTeacherMapper.countByExample(example);
		if (count > 0)
			return true;
		return false;
	}

	public boolean checkCurseId(int curseId) {
		HzClassCourseExample example = new HzClassCourseExample();
		example.createCriteria().andIdEqualTo(curseId);
		int count = hzClassCourseMapper.countByExample(example);
		if (count > 0)
			return true;
		return false;
	}
	
	
	
}
